-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add show axis to timeseries #26409
base: master
Are you sure you want to change the base?
Conversation
/testenv up |
@john-bodley Ephemeral environment creation is currently limited to committers. |
@john-bodley Sure, I just added some background information. But I don't know why the check is giving me an error, can you help me out? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass comments
minorSplitLine, | ||
truncateYAxis, | ||
yAxisBounds, | ||
zoomable, | ||
orientation, | ||
showAxis, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be here twice
const yAxisLeftOffset = showAxis | ||
? 0 | ||
: TIMESERIES_CONSTANTS.yAxisLabelLeftOffset; | ||
let leftOffset: number; | ||
if (yAxisTitlePosition === 'Left' && showAxis) { | ||
leftOffset = | ||
TIMESERIES_CONSTANTS.gridOffsetLeft + (Number(yAxisTitleMargin) || 0); | ||
} else if (yAxisTitlePosition === 'Left' && !showAxis) { | ||
leftOffset = | ||
TIMESERIES_CONSTANTS.gridOffsetLeft + | ||
(Number(yAxisTitleMargin) || 0) - | ||
(Number(yAxisLeftOffset) || 0); | ||
} else if (yAxisTitlePosition !== 'Left' && !showAxis) { | ||
leftOffset = | ||
TIMESERIES_CONSTANTS.gridOffsetLeft - (Number(yAxisLeftOffset) || 0); | ||
} else { | ||
leftOffset = TIMESERIES_CONSTANTS.gridOffsetLeft; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is maybe slightly heavy on the eyes. Would it be possible to add a few comments here explaining what's going on? Or better yet, maybe add a few self explanatory tests?
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #26409 +/- ##
==========================================
+ Coverage 69.48% 69.51% +0.02%
==========================================
Files 1894 1905 +11
Lines 74138 74727 +589
Branches 8243 8250 +7
==========================================
+ Hits 51514 51945 +431
- Misses 20555 20710 +155
- Partials 2069 2072 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Legend! I was just mentioning this exact enhancement in slack a month or so ago. https://apache-superset.slack.com/archives/CCKHMGRRB/p1706055529343849. Useful feature for just making nicer looking dashboard. |
Looks like this needs a rebase. And @john-bodley can hopefully spin up a test this time when CI passes ;) |
SUMMARY
Adding Show/Hide Axis Controls to Bar charts.
For Bar charts or Line charts, if I add values to the bar or to the line, then I may not need to show the axis because it would interfere with the look and feel and would not be aesthetically pleasing, such as the following:
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
20240104-183647.mp4
TESTING INSTRUCTIONS
Create a Bar chart and click on the Y Axis in CUSTOMIZE and unfilter "SHOW AXIS" to hide the Y Axis (HORIZONTAL is the X Axis).
ADDITIONAL INFORMATION